package com.typy.www.tpay.util;

import android.content.Context;
import android.widget.Toast;

/**
 * Created by 13799 on 2018/6/2.
 */

public class ToastUtil {
    public static ToastUtil instance;
    private Context mContext;
    public ToastUtil(Context context) {
        mContext=context;
    }

    public static ToastUtil getInstance() {
        return instance;
    }
    public static void init(Context context){
        if(instance==null){
            instance=new ToastUtil(context);
        }
    }
    public void show(String msg){
        Toast.makeText(mContext,msg,Toast.LENGTH_SHORT).show();
    }

    public static void show(Context context, String msg){
        if(context!=null)
        Toast.makeText(context,msg,Toast.LENGTH_SHORT).show();
    }
}
